package org.asg.dis.repository;

import org.asg.dis.model.Shipment;
import org.asg.dis.model.ShipmentStatus;
import org.asg.dis.model.Trace;
import org.springframework.data.jpa.repository.JpaRepository;
import java.util.List;
import java.util.UUID;

public interface TraceRepository extends JpaRepository<Trace, UUID> {

    // 根据货件ID查询所有运输历史记录，按时间顺序排序
    List<Trace> findByShipmentIdOrderByTimestampAsc(Shipment shipment);

    // 根据状态查询运输历史记录
    List<Trace> findByStatus(ShipmentStatus status);
}
